#include "../include/UnrealBotInfo.h"

using namespace Gtk;
using namespace std;

UnrealBotInfo::UnrealBotInfo(UnrealNativeBot* bot)
{
    //ctor
    pack_end(team, PACK_SHRINK, 2);
    pack_end(name, PACK_EXPAND_WIDGET, 2);
    pack_end(weapon, PACK_EXPAND_WIDGET, 2);
    setSubject(bot);
}

UnrealBotInfo::~UnrealBotInfo()
{
    //dtor
}


void UnrealBotInfo::setSubject(UnrealNativeBot* val)
{
    m_subject = val;
    update();
}
void UnrealBotInfo::update(){
    team.setTeam(m_subject->team);
    name.set_text(m_subject->name);
	if(m_subject->weapon.empty())
		weapon.set_text("[no weapon]");
	else
		weapon.set_text(m_subject->weapon.substr(m_subject->weapon.find(".")));
}
